package com.rc.saas.tenant.mapper.elec;


import com.rc.saas.tenant.common.base.BaseMapper;
import com.rc.saas.tenant.model.elec.ElecGun;
import com.rc.saas.tenant.model.elec.ElecGunExample;
import com.rc.saas.tenant.model.elec.ElecStation;
import com.rc.saas.tenant.search.StatisticsSearch;
import com.rc.saas.tenant.search.elec.ElecGunSearch;
import com.rc.saas.tenant.vo.elec.ElecPileStatusCountVo;
import com.rc.saas.tenant.vo.gun.ElecGunMonitorChartVo;
import com.rc.saas.tenant.vo.gun.ElecGunMonitorVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ElecGunMapper extends BaseMapper<Long , ElecGun, ElecGunExample> {
    long countUseGun(String tenantCode);

    long countGun(String tenantCode);

    void updateBatchElecGunOperateStatusByElecStationIdList(@Param("elecStationIdList") List<Long> elecStationIdList,@Param("operateStatus") String operateStatus);

    List<ElecGun> listElecGunByElecStationIdList(@Param("elecStationIdList") List<Long> elecStationIdList);

    List<ElecGun> listElecGunByElecPileIdList(@Param("elecPileIdList") List<Long> elecPileIdList);

    ElecGun selectLastGunNo(@Param("tenantCode") String tenantCode,@Param("elecPileId") Long elecPileId);

    List<ElecGun> listByCondition(ElecGunSearch elecGunSearch);

    List<ElecGunMonitorVo> listPageByMonitor(ElecGunSearch elecGunSearch);

    List<ElecGunMonitorChartVo> listChartByMonth(@Param("stationNo") String stationNo ,@Param("date") Date date);

    List<ElecGunMonitorChartVo> listChartByDay(@Param("stationNo") String stationNo ,@Param("date") Date date);

//    List<ElecGunMonitorVo> listPageByStationNameOrStationNo(String stationName, String type, Date date);

    ElecGun selectByGunNo(@Param("gunNo") String gunNo);

    ElecGun selectByOperatorName(@Param("operatorName") String operatorName);

    ElecPileStatusCountVo countGunInConsole(StatisticsSearch search);

    void updateGunOperators(Long pileId,Long operatorId,Long elecStationId);

    void updateOperatorBySId(ElecStation elecStation);
}
